#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->lineEdit_name->setPlaceholderText("请输入姓名");
    ui->lineEdit_name->setClearButtonEnabled(true);

    ui->lineEdit_password->setPlaceholderText("请输入密码");
    ui->lineEdit_password->setClearButtonEnabled(true);
    ui->lineEdit_password->setEchoMode(QLineEdit::Password);

    ui->lineEdit_tele->setPlaceholderText("请输入电话号码");
    ui->lineEdit_tele->setClearButtonEnabled(true);

    //手机号码也是有固定格式的,此处0代表数字格式
    ui->lineEdit_tele->setInputMask("000-0000-0000");
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_submmit_clicked()
{
    QString gender=ui->radioButton_male->isChecked()?"男":"女";
    qDebug()<<"姓名："<<ui->lineEdit_name->text()
            <<"密码："<<ui->lineEdit_password->text()
            <<"性别："<<gender
             <<"电话："<<ui->lineEdit_tele->text();
}

